package Book;

public class Book {
    private String name;

    private String author;

    private double price;

    private boolean borrow;

    public Book(String name, String author, double price) {
        this.name = name;
        this.author = author;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }

    public boolean isBorrow() {
        return borrow;
    }

    public void setBorrow(boolean borrow) {
        this.borrow = borrow;
    }

    @Override
    public String toString() {
        return "Book{" +
                "书名 ：'" + name + '\'' +
                ", 作者 ：'" + author + '\'' +
                ", 价格 ：" + price +
                ((borrow)?"  已被借出":"  未被借出")+
//                ", borrow=" + borrow +
                '}';
    }
}


